<?php

$ip = '120.31.131.231'; // redis服务器ip地址
$port = '6379'; // redis服务器端口
$passwd = '!@#$981596276'; // redis密码
$redis = new Redis();
$state = $redis->connect($ip, $port);
if ($state == false) {
    die('redis connect failure');
}
$redis->auth($passwd);
$key = "list-data";
for($i=0;$i<=1000;$i++){
    $arr = [
        "order_id"=>"2018",
        "channel"=>"1",
        "bank_money"=>mt_rand(1,888),
        "notify_type"=>1,
    ];
    $redis->lPush($key, json_encode($arr));
}
echo "ok";
$data = $redis->brPop($key, 2);
var_dump(json_decode($data[1],true));

